import Nofound from '.././views/Nofound.vue'
import Login from '../views/login/Login.vue'
import Register from '../views/login/Register.vue'
import Cert from '../views/login/Cert.vue'
import Forget from '../views/login/Forget.vue'
import Home from '.././views/Home.vue'
import Set from '../views/user/Set.vue'
import Passwd from '../views/user/Passwd.vue'
import Paypwd from '../views/user/Paypwd.vue'
import Phone from '../views/user/Phone.vue'
import Info from '../views/user/Info.vue'
import Account from '../views/account/Account.vue'
import Recharge from '../views/account/Recharge.vue'
import RechargeSuccess from '../views/account/RechargeSuccess.vue'
import Transfer from '../views/account/Transfer.vue'
import TransferSuccess from '../views/account/TransferSuccess.vue'
import GameRecharge from '../views/game/GameRecharge.vue'
import GameSuccess from '../views/game/GameSuccess.vue'
import Withdraw from '../views/withdraw/Withdraw.vue'
import WithdrawList from '../views/withdraw/WithdrawList.vue'
import WithdrawSuccess from '../views/withdraw/WithdrawSuccess.vue'
import ReleaseList from '../views/good/ReleaseList.vue'
import Release from '../views/good/Release.vue'
import Good from '../views/good/Good.vue'
import GoodList from '../views/good/GoodList.vue'
import OrderList from '../views/good/OrderList.vue'
import OrderDetail from '../views/good/OrderDetail.vue'

const routers = [
    // 登录
    {
        path: '/login',
        name: 'login',
        component: Login,
        meta: { requiresAuth: false, title: '用户登录' }
    },
    {
        path: '/register',
        name: 'register',
        component: Register,
        meta: { requiresAuth: false, title: '新用户注册' }
    },
    {
        path: '/forget',
        name: 'forget',
        component: Forget,
        meta: { requiresAuth: false, title: '忘记密码' }
    },
    // 内容的模板
    {
        path: '/',
        name:'',
        meta: {requiresAuth: true, title: '用户首页'},
        children: [
            {
                path: 'good/list',
                name: 'good-list',
                component: GoodList,
                meta: { 
                    title: '装备交易',
                    keepAlive: true,
                },
            },
            {
                path: 'good/detail/:id',
                name: 'good-detail',
                component: Good,
                meta: { title: '装备详情' },
            },
            {
                path: 'order/list',
                name: 'order-list',
                component: OrderList,
                meta: {
                    title: '交易记录',
                    keepAlive: true,
                },
            },
            {
                path: 'order/detail/:id',
                name: 'order-detail',
                component: OrderDetail,
                meta: { title: '交易状态' },
            },
            {
                path: 'good/release/list',
                name: 'ReleaseList',
                component: ReleaseList,
                meta: {
                    title: '我发布的',
                    keepAlive: true,
                },
            },
            {
                path: 'good/release/:id?',
                name: 'good-release',
                component: Release,
                meta: { title: '发布装备' },
            },
            {
                path: 'withdraw/list',
                name: 'withdraw-list',
                component: WithdrawList,
                meta: { title: '提现记录',keepAlive: true, },
            },
            {
                path: 'withdraw/success/:id',
                name: 'withdraw-success',
                component: WithdrawSuccess,
                meta: { title: '提现状态' },
            },
            {
                path: 'withdraw/index',
                name: 'withdraw',
                component: Withdraw,
                meta: { title: '提现' },
            },
            {
                path: 'game/recharge/success/:id',
                name: 'GameSuccess',
                component: GameSuccess,
                meta: { title: '转账成功' },
            },
            {
                path: 'game/recharge/:coin/:money',
                name: 'GameRecharge',
                component: GameRecharge,
                meta: { title: '游戏充值' },
            },
            {
                path: 'account/transfer/success/:id',
                name: 'transfer-success',
                component: TransferSuccess,
                meta: { title: '转账成功' },
            },
            {
                path: 'account/transfer',
                name: 'transfer',
                component: Transfer,
                meta: { title: '转账' },
            },
            {
                path: 'account/recharge/success/:id',
                name: 'recharge-success',
                component: RechargeSuccess,
                meta: { title: '代币充值成功' },
            },
            {
                path: 'account/recharge',
                name: 'recharge',
                component: Recharge,
                meta: { title: '代币充值' },
            },
            {
                path: 'account/index',
                name: 'Account',
                component: Account,
                meta: {
                    title: '代币',
                    keepAlive: true,
                },
            },
            {
                path: 'cert',
                name: 'cert',
                component: Cert,
                meta: { title: '防沉迷认证' },
            },
            {
                path: '',
                name: 'home',
                component: Home,
                meta: { title: '用户中心' },
            },
            {
                path: 'user/set',
                name: 'set',
                component: Set,
                meta: { title: '设置' },
            },
            {
                path: 'user/passwd',
                name: 'passwd',
                component: Passwd,
                meta: { title: '修改密码' },
            },
            {
                path: 'user/paypwd',
                name: 'paypwd',
                component: Paypwd,
                meta: { title: '修改支付密码' },
            },
            {
                path: 'user/phone',
                name: 'phone',
                component: Phone,
                meta: { title: '修改用户手机号' },
            },
            {
                path: 'user/info',
                name: 'info',
                component: Info,
                meta: { title: '提现账户维护' },
            },
        ]
    },
    // 其它404
    {
        path: '/:catchAll(.*)',
        name: 'nofound',
        meta: { requiresAuth: false, title: '未找到页面' },
        component: Nofound
    },
]

export default routers